package com.logos.ruralrevitalization.enums;


import lombok.Getter;


/**
 * 用户性别枚举
 */
@Getter
public enum UserSexEnum {

    MALE(1,"男"),
    FEMALE(0,"女");

    public int code;

    public String desc;

    UserSexEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static UserSexEnum getByCode(int codeVal){
        for(UserSexEnum resultCodeEnum: UserSexEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
